<script lang="ts">
  import { Tab, Tabs } from "@component/tab/index";
  import DataEntrySidebar from "@routes/(authorized)/dataset/[dataset_code]/file/DataEntrySidebar.svelte";
  import type { LayoutData } from "./$types";
  export let data: LayoutData;
  let activeTab = 2;
</script>

<Tabs prerender={true} active={activeTab}>
  <Tab label="数据集概览" href={data.baseUrl + "/overview"}>
    <div class="p-2">README.md</div>
  </Tab>
  <Tab label="数据集文件" href={data.baseUrl + "/entries"}>
  </Tab>
  <Tab label="数据集标注" href={data.baseUrl + `/file/${data.entry.id}/annotation`}>
    <div class="flex-container flex w-full h-full">
      <div class="w-1/4 h-full px-2 pt-2">
        <DataEntrySidebar entry={data.entry} />
      </div>
      <div class="grow px-2 pt-2 h-full">
        <slot />
      </div>
    </div>
  </Tab>
</Tabs>